import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;


public class ReadFileHelper {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		InputStream in = null;
		try {
			
			// Open the file that is the first
			// command line parameter
			FileInputStream fstream = new FileInputStream("\\tmp\\test.txt");
			// Get the object of DataInputStream
			in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String strLine;
			// Read File Line By Line
			while ((strLine = br.readLine()) != null) {
				System.out.println(strLine);
			}

			in.close();
		} catch (IOException e) {
			// Catch exception if any
			System.err.println("Error: " + e.getMessage());
		} 
	}
	
	private int sqrt(int n) {
		int count = 0;
		int cur_term = 1;
		int next_term = 1;
		if (n < 2) {
			return (n);
		}

		while (cur_term <= n) {
			cur_term += next_term;
			next_term += 2;
			count++;
		}
		return (count);
	}




}
